package com.woniu.bh.common.core.exception;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * @version: V1.0
 * @author: Xbao
 * @className: ProjectionException
 * @packageName: com.woniu.project.common.core.exception
 * @description: 项目异常
 * @data: 2020-09-27 19:34
 */
@Data
@AllArgsConstructor
public class ProjectException extends RuntimeException {
    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public ProjectException(){}

    public ProjectException(Integer code, String message){
        super(message);
        this.code = code;
    }

    public ProjectException(ProjectExceptionResult projectExceptionResult){
        super(projectExceptionResult.getMessage());
        this.code = projectExceptionResult.getCode();
    }
}
